feat: add terminal_enabled config flag for the built in nvim terminal#73
feat: add terminal_enabled config flag for the built in nvim terminal#73mpataki wants to merge 1 commit intocoder:mainfrom
Conversation
|
Just what I was looking for, thanks @mpataki! Here's a vim command that will copy the commandline to the clipboard so you can paste it into your nearest (external) terminal: vim.api.nvim_create_user_command("ClaudeCodeCopyCommand", function(opts)
local claudecode = require("claudecode")
if not claudecode.state or not claudecode.state.port then
vim.notify("Claude Code Neovim MCP Server is not running", vim.log.levels.ERROR)
return
end
local port = claudecode.state.port
vim.fn.setreg("+", "CLAUDE_CODE_SSE_PORT=" .. port .. " ENABLE_IDE_INTEGRATION=true FORCE_CODE_TERMINAL=true claude")
vim.notify("Claude Code command copied to clipboard", vim.log.levels.INFO)
end, {})This will copy the following to your clipboard: CLAUDE_CODE_SSE_PORT=48464 ENABLE_IDE_INTEGRATION=true FORCE_CODE_TERMINAL=true claudeFrom there you can paste it into you favourite terminal. EditJust realised that you can also connect a running claude code instance to neovim by using the You just need to start the WebSocket server by running |
|
This is great because the current terminal fails on pasting full long text |
|
Hey @mpataki, thanks for opening this PR. Another PR (#50) is currently open that proposes adding an
Since a few versions of Claude Code, you can also launch Claude Code with an --ide Automatically connect to IDE on startup if exactly one valid IDE is available |
This change adds an
enable_terminalconfig flag which controls whether the plugin will use a nvim terminal buffer to run claude code (as it currently does by default). This flag defaults totrue, thereby retaining the current behaviour and maintaining backward compatibility for existing users.Reasoning behind this, some users like myself prefer to use a terminal multiplexer like tmux or zellij to run claude code. While nvim terminal buffers make great sense as a default, claudecode.nvim needn't mandate them as the only way to run claude code IMHO.